﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SCBX
{
    public partial class MenuPop : ContextMenuStrip
    {
        private bool _IsLoad = false;
        public MenuPop()
        {
            InitializeComponent(); 
        }

        private void MenuPop_Opening(object sender, CancelEventArgs e)
        {
            if(!_IsLoad)
            {
                Add_Image();
                _IsLoad = true;
            }
            
        }

        private void Add_Image()
        {
            if (this.Items["mAdd"] != null)
            {
                this.Items["mAdd"].Image = SCBX.Properties.Resources.add2;
                this.Items["mAdd"].ForeColor = Color.Green;
            }                

            if (this.Items["mEdit"] != null)
                this.Items["mEdit"].Image = SCBX.Properties.Resources.edit2;

            if (this.Items["mDelete"] != null)
            {
                this.Items["mDelete"].Image = SCBX.Properties.Resources.delete2;
                this.Items["mDelete"].ForeColor = Color.Red;
            }                

            if (this.Items["mView"] != null)
                this.Items["mView"].Image = SCBX.Properties.Resources.view2;

            if (this.Items["mDuplicate"] != null)
                this.Items["mDuplicate"].Image = SCBX.Properties.Resources.duplicate2;

            if (this.Items["mSearch"] != null)
                this.Items["mSearch"].Image = SCBX.Properties.Resources.search2;

            if (this.Items["mRefresh"] != null)
                this.Items["mRefresh"].Image = SCBX.Properties.Resources.refresh2;

            if (this.Items["mPrint"] != null)
                this.Items["mPrint"].Image = SCBX.Properties.Resources.print2;

            if (this.Items["mSystemInfo"] != null)
            {
                this.Items["mSystemInfo"].Image = SCBX.Properties.Resources.info2;
                //this.Items["mSystemInfo"].ForeColor = Color.Blue;
            }                

            if (this.Items["mExportExcel"] != null)
                this.Items["mExportExcel"].Image = SCBX.Properties.Resources.excel2;

            if (this.Items["mMemberGroup"] != null)
                this.Items["mMemberGroup"].Image = SCBX.Properties.Resources.manager2;
        }

    }
}
